# _*_ coding:utf-8 _*_
# @Time  : 2023.02.20
# @Author: zizlee
from WindPy import w
w.start()
LogonID = w.tlogon('0000', 0, ['M4SK1M20002'], '000000', ['shf', 'cfe', 'czc'])
print(LogonID)
# ret = w.torder('AP305.CZC', 'Cover ', '8930', 1, "LogonID=3")
# print('-----')
# print(ret)
# print('-----')
r = w.tquery('Order', "LogonID=3")
print(r)
w.tlogout()

"""
.ErrorCode=0
.Fields=[LogonID,LogonAccount,AccountType,ErrorCode,ErrorMsg]
.Data=[[1,2,3],[M4SK1M20002,M4SK1M20002,M4SK1M20002],[SHF,CFE,CZC],[0,0,0],[,,]]
-----
.ErrorCode=0
.Fields=[RequestID,SecurityCode,TradeSide,OrderPrice,OrderVolume,LogonID,ErrorCode,ErrorMsg]
.Data=[[10],[AP305.CZC],[COVER],[8930],[1],[3],[0],[Sending ...]]
-----
.ErrorCode=0
.Fields=[OrderNumber,OrderStatus,SecurityCode,SecurityName,TradeSide,OrderPrice,OrderVolume,OrderTime,TradedPrice,TradedVolume,...]
.Data=[[1,3,4,5],[Cancelled,Normal,Normal,Normal],[AP305.CZC,AP305.CZC,AP305.CZC,AP305.CZC],[苹果2305,苹果2305,苹果2305,苹果2305],[Buy,Buy,Short,Cover],[8908.0,8910.0,8940.0,8930.0],[1,1,1,1],[2023-02-20 14:10:08,2023-02-20 14:24:09,2023-02-20 14:27:32,2023-02-20 14:31:47],[0.0,0.0,8943.0,0.0],[0,0,1,0],...]

"""